<template>
  <svg class="svg-icon" aria-hidden="true">
    <use :xlink:href="iconName"></use>
  </svg>
</template>

<script lang="ts" setup>
  import { ref, defineProps, computed } from 'vue';

  const props = defineProps({
    iconClass: {
      type: String,
      required: true,
    },
  });
  const iconName = computed(() => `#${props.iconClass}`);
</script>

<style scoped>
  .svg-icon {
    width: 1em;
    height: 1em;
    font-size: 18px;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
  }
</style>
